package javacode.chapter07.homework;

public class Homework12 {
}

/**
 * 创建一个Employee类，属性有(名字，性别，年龄，职位，薪水)
 * 提供3个构造方法，可以初始化
 * (1) (名字，性别，年龄，职位，薪水),
 * (2) (名字，性别，年龄) (3) (职位，薪水),
 * 要求充分复用构造器
 *
 */

class Employee {
    String name;
    Boolean sex;
    int age;
    String position;
    int salary;

    Employee(){
    }

    Employee(String name, Boolean sex, int age, String position, int salary){
//        this.name = name;
//        this.sex = sex;
//        this.age = age;
        this(name,sex,age);//使用其他的构造器
        this.position = position;
        this.salary = salary;
    }
    Employee(String name, Boolean sex, int age){
        this.name = name;
        this.sex = sex;
        this.age = age;
    }
    Employee(String position, int salary){
        this.position = position;
        this.salary = salary;
    }
}